package com.lelouch.param;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 用户参数
 *
 * @author lcy
 * @create 2018-06-19 16:32
 */
@Setter
@Getter
@ToString
public class UserParam {

    private Integer id;

    @NotBlank(message = "用户名不可以为空")
    @Length(min = 1,max=20,message = "用户名的长度要在20个字符以内")
    private String username;

    @NotBlank(message = "电话号码不可以为空")
    @Length(min = 1,max=13,message = "电话号码的长度要在13个字符以内")
    private String telephone;

    @NotBlank(message = "电子邮箱不可以为空")
    @Length(min = 5,max=50,message = "电子邮箱的长度要在50个字符以内")
    private String mail;

    @NotNull(message = "用户所属的部门id不可以为空")
    private Integer deptId;

    @NotNull(message = "用户的状态不可以为空")
    @Max(value = 2,message = "用户状态不合法")
    @Min(value = 0,message = "用户状态不合法")
    private Integer status;

    @Length(min = 0,max=200,message = "备注的长度要在50个字符以内")
    private String remark;

}
